package com.aizuda.boot.modules.business.contract.entity.dto;

import com.aizuda.boot.modules.common.constant.enums.QueryType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
@Schema(description = "合同列表查询请求")
public class ContractListReqDTO {
    
    @Schema(description = "查询类型：0-全部合同，1-我的合同，2-我的草稿",required = true)
    private QueryType queryType;

    @Schema(description = "当前用户id（必传）")
    private Long  userId;

    @Schema(description = "页码，从1开始，默认1")
    private Integer pageIndex = 1;

    @Schema(description = "每页大小，默认10")
    private Integer pageSize = 10;

    // 新增搜索条件
    @Schema(description = "合同状态列表（特殊处理）")
    private List<String> contractStatusList;

    @Schema(description = "动态字段搜索条件数组")
    private List<DynamicFieldSearchCondition> dynamicFieldConditions;

    @Schema(description = "模糊匹配关键字（匹配员工表头配置中的SINGLE_TEXT和MULTI_TEXT字段）")
    private String fuzzySearchKeyword;

    @Schema(description = "模糊匹配字段ID（如果不传则匹配所有文本类型字段）")
    private Long fuzzySearchFieldId;

    @Data
    @Schema(description = "动态字段搜索条件")
    public static class DynamicFieldSearchCondition {
        @Schema(description = "字段ID", required = true, example = "25")
        private Long fieldId;

        @Schema(description = "字段类型", required = true, example = "DROPDOWN_SINGLE")
        private String fieldType;

        @Schema(description = "搜索值，单值搜索时传字符串，范围搜索时传数组", required = true)
        private Object value;
    }
} 